/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						script_specific_hero_boolean_expression.h

	$Header: /heroes4/script_specific_hero_boolean_expression.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_SPECIFIC_HERO_BOOLEAN_EXPRESSION_H_INCLUDED )
#define SCRIPT_SPECIFIC_HERO_BOOLEAN_EXPRESSION_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>

#include "abstract_script_expression.h"
#include "script_expression_type.h"

// --------------------------------------------------------------------------
// t_script_specific_hero_boolean_expression class
// --------------------------------------------------------------------------

class t_script_specific_hero_boolean_expression
	:	public t_abstract_script_boolean_expression
{
public:
	// Member functions
	virtual t_result	evaluate(t_expression_context_hero const& context) const;
	virtual t_result	evaluate(t_expression_context_town const& context) const;
	virtual t_result	evaluate(t_expression_context_object const& context) const;
	virtual t_result	evaluate(t_expression_context_army const& context) const;
	virtual t_result	evaluate(t_expression_context_global const& context) const;

	std::string const &	get_hero_name() const;
	virtual bool		read( std::streambuf & stream, int version );
	virtual bool		read_from_map(
							std::streambuf &	stream,
							int					format_version );
	virtual bool		write( std::streambuf & stream ) const;

private:
	// Data members
	std::string	m_hero_name;

	virtual t_result	do_evaluate(t_hero const* hero) const = 0;
};

// --------------------------------------------------------------------------
// t_script_specific_hero_boolean_expression inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline std::string const &
t_script_specific_hero_boolean_expression::get_hero_name() const
{
	return m_hero_name;
}

// --------------------------------------------------------------------------
// t_script_hero_is_dead class
// --------------------------------------------------------------------------

class t_script_hero_is_dead
	:	public t_script_specific_hero_boolean_expression
{
public:
	// Member functions
	virtual t_result	do_evaluate(t_hero const* hero) const;
};

SPECIALIZE_SCRIPT_BOOLEAN_EXPRESSION( k_script_boolean_hero_is_dead, t_script_hero_is_dead );

// --------------------------------------------------------------------------
// t_script_hero_is_imprisoned class
// --------------------------------------------------------------------------

class t_script_hero_is_imprisoned
	:	public t_script_specific_hero_boolean_expression
{
public:
	// Member functions
	virtual t_result	do_evaluate(t_hero const* hero) const;
};

SPECIALIZE_SCRIPT_BOOLEAN_EXPRESSION( k_script_boolean_hero_is_imprisoned, t_script_hero_is_imprisoned );

#endif // !defined( SCRIPT_SPECIFIC_HERO_BOOLEAN_EXPRESSION_H_INCLUDED )
